<script setup lang="ts">
defineProps<{
    zIndex?: number,
}>()
const emit = defineEmits<{
    (e: 'close'): void
}>()
</script>

<template>
    <div class="prompt fixFill" :style="{zIndex}">
        <div class="background fixFill"></div>
        <div class="panel">
            <button class="panelCloseBtn cancel" @click="emit('close')">×</button>
            <slot></slot>
        </div>
    </div>
</template>

<style lang="scss" scoped>
.prompt{
    z-index: 20000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.fixFill{
    position: fixed;
    inset: 0px;
}
.background{
    background-color: black;
    opacity: 0.2;
}
.panel{
    border-radius: 10px;
    box-shadow: 0 0 10px 0 black;
    background-color: white;
    padding: 25px 20px 20px 20px;
    z-index: 20001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    button{
        position: absolute;
        top: 2px;
        right: 2px;
        width: 35px;
        height: 20px;
        line-height: 20px;
        font-size: 20px;
        padding: 0px;
        margin: 0px;
        border-radius: 10px;
    }
}
</style>